package ezXpns.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import ezXpns.TypeRegistry;


//@author A0086934R
public class TypeRegistryTest {

	@Test
	public void testConstructor() {
		TypeRegistry TR1 = new TypeRegistry();
		
		assertNotNull(TR1);
	}
	
	public void testChange() {
		TypeRegistry TR2 = new TypeRegistry();
		
		assertTrue(TR2.addType("a1"));
		assertFalse(TR2.addType("a1"));
		
		
		assertTrue(TR2.hasType("a1"));
		assertFalse(TR2.hasType("a2"));
		
		assertTrue(TR2.renameType("a1", "a2"));
		assertFalse(TR2.renameType("a1", "a2"));

		assertTrue(TR2.hasType("a2"));
		assertFalse(TR2.hasType("a1"));
		
		TR2.removeType("a2");
		assertFalse(TR2.hasType("a2"));
		assertFalse(TR2.hasType("a1"));
	}

}
